import Http from '../http';

export const login = function(loginForm: any) {
    return Http.post('/user/login', loginForm)
}

export const selectUserPage = function(params:{}) {
    return Http.get('/sys-user/page',params)
}

export const addUser = function (data: object) {
    return Http.post("/sys-user/add",data)
};

export const simpleInfoUser = function (id: Number) {
    return Http.get("/sys-user/simpleInfo/"+id)
};

export const detailUser = function (id: Number) {
    return Http.get("/sys-user/detail/"+id)
};

export const editUser = function (data: object) {
    return Http.post("/sys-user/edit",data)
};

export const removeUser = function (id: Number) {
    return Http.delete("/sys-user/remove/" + id);
};

export const pageUserByRoleId = function (params: object) {
    return Http.get('/sys-user/pageByRoleId',params)
};

export const statusUser = function (data: object) {
    return Http.post("/sys-user/status",data)
};

export const resetUserPassword = function (data: object) {
    return Http.post("/sys-user/resetPassword",data)
};

export const kickOutByToken = function () {
    return Http.post("/sys-user/kickOutByToken")
};


export const simulateLogin = function (data:object) {
    return Http.post("/sys-user/simulateLogin",data)
};

export const viewPassword = function (id:number) {
    return Http.get("/sys-user/viewPassword/"+id)
};